





#include "arch.h"
#include "A.utilities"

//user program


class A{

   private:

      int a;
      int b;
      int c;

      A(){
      }

      A(int x, int y, int z){
         a=x, b=y, c=z;
      }

   public:

      void *operator new(size_t){
           fprintf(Sdf::trace, "node %d, ##############\n", Sdf::PROC_ID);
           fflush(Sdf::trace);
          return new A;
       }

       int geta(){
          return a;
       }

       int getb(){
          return b;
       }

       int getc(){
          return c;
       }

};

class Root_proc: public Thread{

   public:

        Root_proc()
                : Thread((Tmf0_ptr)&Root_proc::body){}

        void body(){

            fprintf(Sdf::trace, "node %d, in Root_proc::starts\n", Sdf::PROC_ID);
            fflush(Sdf::trace);

            A* aa = new A;
            A* a = new A(1,2,3);

            fprintf(Sdf::trace, "node %d, result=%d,%d,%d\n", 
                    Sdf::PROC_ID, a->geta(), a->getb(), a->getc());
            fflush(Sdf::trace);


            fprintf(Sdf::trace, "node %d, in Root_proc::finishes\n", Sdf::PROC_ID);
            fflush(Sdf::trace);
        }
};
//end of user program

MAIN(Root_proc, Sdf::empty, Sdf::empty, Sdf::empty)


